package hos.permission;

import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

/**
 * <p>Title: PermissionFragment </p>
 * <p>Description: 权限申请依托的Fragment </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2024-01-10 22:09
 */
public class PermissionFragment extends Fragment {

    @Nullable
    private PermissionRequest mPermissionDelegate = PermissionDelegate.create(this);

    @NonNull
    public PermissionRequest getPermissionRequest() {
        if (mPermissionDelegate == null) {
            return mPermissionDelegate = PermissionDelegate.create(this);
        }
        return mPermissionDelegate;
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.d("Permission", "onResume: ");
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        mPermissionDelegate = null;
    }
}
